﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using VivahMuhurth.DBAccess;

public partial class Search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        BindDropDownList();
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        //SearchParams objSearchParams = new SearchParams();
        //objSearchParams.Gender = rblGender.SelectedIndex == 0;
        //objSearchParams.FromAge = ddlFromAge.SelectedValue;
        //objSearchParams.ToAge = ddlToAge.SelectedValue;
        //objSearchParams.FromHeight= ddlFromHeight.SelectedValue;
        //objSearchParams.ToHeight = ddlToHeight.SelectedValue;
        //objSearchParams.ReligionID = Convert.ToInt32(ddlReligion.SelectedValue);
        //objSearchParams.CasteID = Convert.ToInt32(ddlCast.SelectedValue);
        //objSearchParams.SubCasteID = Convert.ToInt32(ddlSubcast.SelectedValue);
        //objSearchParams.EducationID = Convert.ToInt32(ddlEducation.SelectedValue);
        //objSearchParams.MaritialStatus = Convert.ToInt32(rblMaritialStatus.SelectedValue);
        //objSearchParams.IsWithPhoto = chkShowPhoto.Checked;

        Response.Redirect("ProfileList.aspx");
    }
    private void BindDropDownList()
    {
        DBAccess dBAccess = new DBAccess();

        try
        {
            ddlFromAge.DataSource = ddlToAge.DataSource = dBAccess.GetAgelist(); ddlToAge.DataBind(); ddlFromAge.DataBind();
            ddlReligion.DataSource = dBAccess.GetReligion(); ddlReligion.DataBind();
            ddlCast.DataSource = dBAccess.GetCast(); ddlCast.DataBind();
            ddlSubcast.DataSource = dBAccess.GetSubCast(); ddlSubcast.DataBind();
            ddlMotherTongue.DataSource = dBAccess.GetLanguagelist(); ddlMotherTongue.DataBind();
            ddlFromHeight.DataSource = ddlToHeight.DataSource = dBAccess.GetHeightlist(); ddlFromHeight.DataBind(); ddlToHeight.DataBind();
            ddlEducation.DataSource = dBAccess.GetEducation(); ddlEducation.DataBind();

            ddlFromAge.Items.Insert(0, "Any");
            ddlToAge.Items.Insert(0, "Any");
            ddlReligion.Items.Insert(0, "Any");
            ddlCast.Items.Insert(0, "Any");
            ddlSubcast.Items.Insert(0, "Any");
            ddlMotherTongue.Items.Insert(0, "Any");
            ddlFromHeight.Items.Insert(0, "Any");
            ddlToHeight.Items.Insert(0, "Any");
            ddlEducation.Items.Insert(0, "Any");
            
        }
        catch
        {
            throw;
        }
    }
}
